# -*- coding: utf-8 -*-
# @author: HRUN

import json
def save_data(data):
    # 每次运行时都会覆盖之前的内容
    with open('data.json', 'w', encoding='utf-8') as f:
        json.dump(data, f, ensure_ascii=False, indent=4)

def load_data():
    try:
        with open('data.json', 'r', encoding='utf-8') as f:
            return json.load(f)
    except FileNotFoundError:
        return None